package com.flying.ouyu.ui;

import com.flying.client.utils.ByteHelper;
import com.flying.client.utils.Logger;
import com.flying.ouyu.R;
import com.flying.ouyu.base.BaseActivity;
import com.flying.ouyu.view.model.MainView;

import android.os.Bundle;
import android.view.View;

public class MainActivity extends BaseActivity {
	private static final Logger logger = Logger.getLogger(MainActivity.class.getName());
    
	private MainView mainView;
	
	
	
	/** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
    	logger.debug("onCreate");
    	
        super.onCreate(savedInstanceState, R.layout.act_main);

        createMainView();
        
        initView();
        
        bindEventOnView();
        
        /*
        int num = 10232;
        byte[] bytesInt = ByteHelper.getBytes(10232);
        
        logger.debug("int = "+ByteHelper.getInt(bytesInt));
        
        String str = "helll哈哈哈sdqas11231哈迪斯";
        byte[] bytesStr = ByteHelper.getBytes(str);
        
        logger.debug("str = "+ByteHelper.getString(bytesStr));
        
        short s = 342;
        
        byte[] bytesShort = ByteHelper.getBytes(s);
        
        logger.debug("short = "+ByteHelper.getShort(bytesShort));
        
        float f = (float) 342.1231;
        
        byte[] bytesFloat = ByteHelper.getBytes(f);
        
        logger.debug("float = "+ByteHelper.getFloat(bytesFloat));
        
        double d = 313123123.21343;
        
        byte[] bytesDouble = ByteHelper.getBytes(d);
        
        logger.debug("double = "+ByteHelper.getDouble(bytesDouble));
        
        long l = (long)1111111111;
        
        byte[] bytesLong = ByteHelper.getBytes(d);
        
        logger.debug("long = "+ByteHelper.getLong(bytesLong));
    	*/
    }
    
    private void createMainView()
    {
    	mainView = new MainView(this);
    }
    
    private void initView()
    {
    	mainView.topBar.btnGoBack.setVisibility(View.GONE);
    }
    
    private void bindEventOnView()
    {
    	mainView.txtTest.setOnClickListener(testClick);
    }
    
    
    
    private View.OnClickListener testClick = new View.OnClickListener() {
		
		public void onClick(View v) {
			LoginActivity.startLoginActivity();
		}
	};
    
}